#include "App_BlueTooth.h"

extern uint8_t Alarm_Reset;
extern uint8_t is_OLEDShow;

void App_BlueTooth_Init(void)
{
    Inf_BLE_Init();
}

void App_BlueTooth_SendInformation(char *Data)
{
    uint8_t data[20] = {0};
    uint16_t data_len = 0;
    Inf_BLE_Receive(data, &data_len);
    if(data_len)
    {
        if(strcmp((char *)data, "System_status") == 0)
        {
            HAL_UART_Transmit(&huart2, (uint8_t *)Data, strlen(Data), 1000);
        }
        else if(strcmp((char *)data, "ResetAlarm") == 0)
        {
            Alarm_Reset = 1;
        }
        else if(strcmp((char *)data, "Shutdown") == 0)
        {
            OLED_Clear();
            OLED_Update();
            is_OLEDShow = 0;
        }
        else if(strcmp((char *)data, "Startup") == 0)
        {
            is_OLEDShow = 1;
        }
        data_len = 0;
    }
}
